@extends('mobile.layout1')
@section('title','购物车')
@section('content')
<body>
@inject('CartService','App\Interfaces\CartService')
	<div class="view-container mgn55">
		<div class="view-inner">
            @if($CartService->getCartNumber() > 0)
			<div class="cart-head">
				<label class="checkbox">
					<input class="cart-inout cart-selectAll" type="checkbox" checked="checked"></input>全选
				</label>
				<span class="cart-head-btn">编辑</span>
			</div>
			<div class="cart-middle js-cart-list">
				<ul class="cart-list js-cart-item">
					@if(count($cart['cartGoods']))
						@foreach($cart['cartGoods'] as $v)
					<li>
						<label class="checkbox">
							<input type="checkbox" class="cart-el" name="goodsSelect" checked="checked"></input>
						</label>
						<div class="cart-item-info">
							<a href="##" class="cart-item-image">
								<img src="{{$v['goods_thumbnail']}}">
							</a>
							<div class="cart-item-options">
								<a href="##" class="weex-ct">
									<p class="goods-title">{{$v['goods_name']}}</p>
								</a>
								<span class="goods-price">￥<span class="goods-price-num">{{$v['cost_price']}}</span></span>
								<p class="goods-type cart-stock-num">{{$v['stock']}}</p>
								<div class="quantity goods-num">
									<button class="minus cart-num-minus disabled" style="padding: 0;text-align: center;">
									<i class="if if-minis"></i></button>

									<input type="tel" class="cart-num" name="cart-num" value="{{$v['buy_num']}}">
									<input type="hidden" class="goods_id"  value="{{$v['goods_id']}}">
									<button class="plus cart-num-plus" style="padding: 0;text-align: center;"><i class="if if-plus"></i></button>
								</div>
							</div>
						</div>
					</li>
						@endforeach
						@else
					@endif

				</ul>
			</div>
			<div class="cart-bottom-pay">
				<p>
					<b>合计：<span>￥<span class="cart-total-price">666</span></span></b>
					<span>免运费</span>
				</p>
				<a href="##">
					<span class="cart-pay-btn" onclick="settlementCart()">结算<i>(<span class="total-num">4</span>)</i></span>
				</a>
			</div>
			<div class="cart-pay-box">
				<p class="del-msg">您当前选择了<i class="red-font total-num">4</i>件商品</p>
				<a href="##" class="cart-del-btn">删除</a>
			</div>
                @else
            <div class="cart-no">
				<div class="cart-no-img"></div>
                <a href="/" class="btn btn-yellow">立即购买</a>
            </div>
                @endif
		</div>
	</div>
	<div class="footer-nav">
		<ul class="nav-items">
			<li>
				<a href="/">
					<div class="footer-icon1"></div>
					<span>商城</span>
				</a>
			</li>
			<li  class="active">
				<a href="/cart">
					<div class="footer-icon2"><em class="has-em" id="hidden" @if($CartService->getCartNumber() == 0)style="display: none" @endif></em>
					</div>
					<span>购物车</span>
				</a>
			</li>
			<li>
				<a href="/user">
					<div class="footer-icon3"></div>
					<span>会员中心</span>
				</a>
			</li>
		</ul>
	</div>
</body>
</html>
@endsection
